/*
 * @Description:
 * @Autor: fage
 * @Date: 2022-06-06 15:10:57
 * @LastEditors: fage
 * @LastEditTime: 2022-07-06 18:31:32
 */
const JSONdb = require("simple-json-db");
const path = require("path");
const fs = require("fs");
let dbfile = path.join(__dirname, "../auto-deploy-db.json");
if (process.platform == "linux") {
  dbfile = "/data/auto-deploy-db.json";
  if (!fs.existsSync(dbfile)) {
    const localdb = path.join(__dirname, "../auto-deploy-db.json");
    fs.copyFileSync(localdb, dbfile);
  }
}
const db = new JSONdb(dbfile);

module.exports = db;
